/*
 * @author java_deng
 * @date 2024/11/29 9:45
 * @description
 */
package org.kaka.service.impl;

import org.kaka.dto.UserDto;
import org.kaka.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    private UserMapper userMapper;
    public Long login(UserDto userDto) {
        UserDto user=userMapper.findByAccount(userDto.getAccount());
        if(user==null){
            return 0L;
        }
        if(!user.getPassword().equals(userDto.getPassword()))
        {
            return 0L;
        }
        return user.getId();
    }
}
